import java.util.concurrent.ExecutionException;
import java.util.concurrent.atomic.AtomicReference;

/**
 * @ClassName A3
 * @Description
 * @Author Jingxiao.Ye
 * @Date 2021/11/28 下午11:13
 * @Version V1.0
 * @Since JDK 11
 */
public class A3 {

    public static void main(String[] args) throws ExecutionException, InterruptedException {
        AtomicReference<Integer> resRef = new AtomicReference<>();
        Thread thread = new Thread(() -> {
            try {
                resRef.set(new Task().call());
            } catch (Exception e) {
                e.printStackTrace();
            }
        });
        thread.start();
        thread.join();
        System.out.println(resRef.get());
    }
}
